package com.skycong.hello77.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.List;

public class ListViewAdapter extends BaseAdapter {
    public List<String> listView;
    public LayoutInflater inflater;

    public ListViewAdapter(Context content,List<String> listView){
        this.listView = listView;
        this.inflater=LayoutInflater.from(content);


    }
    @Override
    public int getCount() {
        return listView.size();
    }

    @Override
    public Object getItem(int position) {
        return listView.get(position) ;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    public void updateView(List<String> nowListView){
        this.listView = nowListView;
        this.notifyDataSetChanged();//强制动态刷新进而调用getView方法
    }
    @Override
    public View getView(int position, View view, ViewGroup viewGroup) {

        return null;
    }
}
